import axios from "axios";
axios.defaults.baseURL = "http://localhost:5000";
export let swiper = () => axios.get("/hb/api/recommend/goodBookList"); //首页顶部轮播图
export let list = () => axios.get("/hb/api/home/getIndexData"); //首页分类列表
export let getFclList = () => axios.get("/hb/api/category/getFcList?position=1"); //全部分类
export let goodsList = (data: { perpage: number; goods_type: string; goods_position: string }) =>
  axios.get("/hb/api/goods/getNecessaryGoodsList", { params: data }); //首页达人书单
export let leaderboard = () => axios.get("/hb/api/leaderboard/homeLeaderboard"); //首页热门数据

interface Sift {
  perpage: number;
  goods_type: string;
  goods_position: string;
  from?: string;
  tag_id?: string;
  attr_var_id?: string;
}
export let sift = (data: Sift) => axios.get("/hb/api/goods/getTalentGoodsList", { params: data }); //首页达人精选 &&书单详情

interface Accept {
  page: string;
  language: string;
  perpage: string;
}
export let accept = (data: Accept) => axios.get("/hb/api/goodsAudio/getList", { params: data }); //听故事

export let details = (id: string) =>
  axios.get("/hb/api/goods/getGoodsDetail", { params: { goods_id: id } }); //绘本，书单详情
export let comment = (id: string) =>
  axios.get("/hb/api/comment/getList", { params: { goods_id: id } }); //评论
